package com.linkcard.commen.action;

import java.util.ArrayList;
import java.util.List;

import org.apache.struts2.ServletActionContext;

import com.linkcard.commen.tools.Page;
import com.linkcard.list.manager.ActivitiesManager;
import com.linkcard.list.manager.BusinessManager;
import com.linkcard.list.manager.LinksManager;
import com.linkcard.list.manager.NewsManager;
import com.linkcard.single.manager.SingleManager;
import com.linkcard.user.manager.WebsiteConfigerManager;
import com.opensymphony.xwork2.ActionSupport;

public class IndexAction extends ActionSupport {

	private BusinessManager businessManager=null;
	private ActivitiesManager activitiesManager=null;
	private NewsManager newsManager=null;
	private LinksManager linksManager=null;
	private SingleManager singleManager=null;
	private WebsiteConfigerManager websiteConfigerManager=null;
	private Page pageObj=null;
	private List businessList=null;
	private List  activitiesList=null;
	private List  newsList=null;
	private List linksList=null;
	private List singlePageList=null;
	private List adList=null;
	@SuppressWarnings("unchecked")
	@Override
	public String execute() throws Exception {
		pageObj=new Page();
		pageObj.setCurrentPage(1);
		pageObj.setPageSize(5);
		businessList=this.businessManager.businessListRecommend(pageObj,1);
		activitiesList=this.activitiesManager.activitesList(pageObj, "");
		newsList=this.newsManager.newsList(pageObj, "");
		linksList=this.linksManager.linksList(pageObj);
		singlePageList=new ArrayList();
		singlePageList.add(this.singleManager.findSinglePage(5));	
		singlePageList.add(this.singleManager.findSinglePage(11));
		String path = ServletActionContext.getRequest().getRealPath("/WEB-INF/classes/ad.xml");
		adList=this.websiteConfigerManager.adList(path);
		return "success";
	}
	public BusinessManager getBusinessManager() {
		return businessManager;
	}
	public void setBusinessManager(BusinessManager businessManager) {
		this.businessManager = businessManager;
	}
	public Page getPageObj() {
		return pageObj;
	}
	public void setPageObj(Page pageObj) {
		this.pageObj = pageObj;
	}
	public List getBusinessList() {
		return businessList;
	}
	public void setBusinessList(List businessList) {
		this.businessList = businessList;
	}
	public ActivitiesManager getActivitiesManager() {
		return activitiesManager;
	}
	public void setActivitiesManager(ActivitiesManager activitiesManager) {
		this.activitiesManager = activitiesManager;
	}
	public List getActivitiesList() {
		return activitiesList;
	}
	public void setActivitiesList(List activitiesList) {
		this.activitiesList = activitiesList;
	}
	public NewsManager getNewsManager() {
		return newsManager;
	}
	public void setNewsManager(NewsManager newsManager) {
		this.newsManager = newsManager;
	}
	public List getNewsList() {
		return newsList;
	}
	public void setNewsList(List newsList) {
		this.newsList = newsList;
	}
	public LinksManager getLinksManager() {
		return linksManager;
	}
	public void setLinksManager(LinksManager linksManager) {
		this.linksManager = linksManager;
	}
	public List getLinksList() {
		return linksList;
	}
	public void setLinksList(List linksList) {
		this.linksList = linksList;
	}
	public SingleManager getSingleManager() {
		return singleManager;
	}
	public void setSingleManager(SingleManager singleManager) {
		this.singleManager = singleManager;
	}
	public List getAdList() {
		return adList;
	}
	public void setAdList(List adList) {
		this.adList = adList;
	}
	public WebsiteConfigerManager getWebsiteConfigerManager() {
		return websiteConfigerManager;
	}
	public void setWebsiteConfigerManager(
			WebsiteConfigerManager websiteConfigerManager) {
		this.websiteConfigerManager = websiteConfigerManager;
	}
	public List getSinglePageList() {
		return singlePageList;
	}
	public void setSinglePageList(List singlePageList) {
		this.singlePageList = singlePageList;
	}

}
